<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"/>
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@taglib prefix="frame" uri="http://www.framework.com/taglib"%>
       <div>
         <input type="hidden" name="projectId" value="${projectId}" id="projectId"/> 	 
         <input type="hidden" name="bidderId" value="${bidderId}" id="bidderId"/>
		 <input type="hidden" name="resId" value="${resId}" id="resId"/>
	       <div class="easyui-panel" data-options="border:true,title:''" style="height:185px;padding: 1px;margin-bottom: 6px">
	         <table id="mydialog" class="easyui-datagrid" 
						data-options="singleSelect:false,method:'post',rownumbers:true,fit:true,fitColumns:true,border:true,
							pagination:false,multiSort:true,remoteSort:true,striped:true,height:300,
							url:'${ctx}/auctionBid/business/finance/getExscuteDeposit?projectId=${projectId}'">
						<thead>
							<tr>
								<th data-options="field:'pk',width:150,title:'单位名称',formatter:fromatterCompanyName" align="center"></th>
								<th data-options="field:'tnAmount',width:60,title:'缴纳金额',sortable:true" align="center"></th>
								<th data-options="field:'transTime',width:130,title:'缴纳时间',sortable:true" align="center"></th>
								<th data-options="field:'hstSeqNum',width:130,title:'交易流水号',sortable:true,formatter:fromatterHstSeqNum" align="center"></th>
								<%--<th data-options="field:'bid',width:80,title:'是否投标',sortable:true,formatter:formatBid" align="center"></th>--%>
								<th data-options="field:'returnOpt',width:80,title:'是否提交退还申请',sortable:true,formatter:formatOpt" align="center"></th>
								<th data-options="field:'status',width:60,title:'退还状态',sortable:true,formatter:formatStatus" align="center"></th>
								<th data-options="field:'addWord',width:60,title:'中间状态',sortable:true"align="center"></th>
								<th data-options="field:'123',width:130,title:'履约保证金退还说明资料',sortable:true,formatter:formatRes" align="center"></th>
						    </tr>
						</thead>
				</table>
	         </div>
       </div>
	    <script type="text/javascript">
	     var projectId=$("#projectId").val();
	    // 是否投标格式化  
						function formatStatus(val, row, index) {
							if (row.status == 0) {
								return '<font color="blue">未退还</font>';
							} else if (row.status == 1) {
								return '<font color="green">已退还</font>';
							} else if (row.status == 2) {
								return '<font color="red">扣除</font>';
							}else if(row.status==-1){
								return '<font color="orange">退还失败</font>';
							}

						}

						//是否提交申请格式化	    
						function formatOpt(val, row, index) {
							if (row.returnOpt == 0) {
								return '<font color="blue">未申请</font>';
							} else if (row.returnOpt == 1) {
								return '<font color="green">申请成功</font>';
							}else if (row.returnOpt == -1){
								return '<font color="orange">申请超时</font>';
							}else if(row.returnOpt == 2){
								return '<font color="red">申请失败</font>';
							}
						}

						//是否投标    
						function formatBid(val, row, index) {
							if (row.isBid == false) {
								return '<font color="red">未投标</font>';
							} else if (row.isBid == true) {
								return '<font color="green">已投标</font>';
							}
						}

						//单位名
						function fromatterCompanyName(val, row, index) {
							if (row.pk) {
								return row.pk.companyName;
							}
						}
						
						//流水号
						function fromatterHstSeqNum(val, row, index) {
							if (row.pk) {
								return row.pk.hstSeqNum;
							}
						}

					   function	formatRes(val, row, index){
						    var resId=$("#resId").val();
						    var ctx="ctx";
                            if(resId!=null){
                                return '<a href="${ctx}/office/plugin/down?resId='+resId+'"}>履约保证金退还说明资料</a>';

							}else{
                                return "无";
							}
					   }
           </script>

                 
   
  
